package com.chuanyang.driverh.mainmy;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import com.chuanyang.driverh.R;
import com.chuanyang.driverh.base.BaseTitleActivity;
import com.chuanyang.driverh.mainmy.fragment.LineManageFragment;
import com.chuanyang.driverh.utils.ActivityUtil;

public class LinesManageActivity extends BaseTitleActivity {
    private Fragment mFragment;

    @Override
    protected int getContentResId() {
        return R.layout.base_single_fragment_activity;
    }

    @Override
    protected void initView(Bundle savedInstanceState) {

    }

    @Override
    protected void initData() {
        getRightTextView().setText("添加");
        setBackImg();
        getTitleTextView().setText("路线管理");

        if (mFragment == null) {
            mFragment = createFragment();
        }
        getSupportFragmentManager().beginTransaction()
                .add(R.id.single_fragment_content, mFragment).commit();

    }
    public Fragment createFragment() {
        Intent intent = getIntent();
        String data = intent.getStringExtra("data");
      return   LineManageFragment.newInstance(data);
    }

    @Override
    protected void initListener() {

    }
    @Override
    protected void baseGoEnsure() {
        ActivityUtil.startActivity(activityContext,AddLinesActivity.class);
    }
}
